package android.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;

public class ChangeBasePasswordActivity extends Activity implements OnClickListener {
	
	int position = 0;
	EditText text1, text2, text3;
	
	public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.change_base_password);
        View button8 = findViewById(R.id.button8);
        button8.setOnClickListener(this);
        View button9 = findViewById(R.id.button9);
        button9.setOnClickListener(this);
        text1 = (EditText)findViewById(R.id.editText6);
        text2 = (EditText)findViewById(R.id.editText7);
        text3 = (EditText)findViewById(R.id.editText8);
    }
	public void onClick(View v) {		
		switch(v.getId()) {
    	case R.id.button8:
    		finish();
    		break;
    	case R.id.button9:
    		Boolean condition = BaseActivity.base.changeMainPassword(text1.getText().toString(), text2.getText().toString(), text3.getText().toString());
    		if(condition == false){
    			Intent i = new Intent(this, WrongPasswordActivity.class);
    			startActivity(i);
    		}
    		finish();
    		break;	
    	}
	}

}
